package com.erpx.api.refund;

import com.erpx.api.WdtClient;
import com.erpx.api.param.PlatformRefundOrderCreateParam;
import com.erpx.utils.JsonUtils;
import com.erpx.api.CommonConstants;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 创建原始退款单接口
 */
public class PlatformRefundCreateService {

    public static void salesRefundPush() throws Exception {
        WdtClient client = new WdtClient(CommonConstants.sid, CommonConstants.appkey, CommonConstants.appSecret, CommonConstants.baseUrl);

        Map<String, String> params = new HashMap<String, String>();
        List<PlatformRefundOrderCreateParam> list = new ArrayList<>();

        params.put("api_refund_list", JsonUtils.serialize(list));
        try {
            String response = client.execute("sales_refund_push.php", params);
            System.out.println(response);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
